﻿using KZ.Express.Resource;

namespace KZ.Express.ENT
{
    public class PartnerENT : EntityBase
    {
        [Output]
        public virtual int PartnerID { get; set; }

        [Require]
        public string PartnerCode { get; set; }

        [Require]
        public string PartnerName { get; set; }

        public bool IsCustomer { get; set; }

        public bool IsSupplier { get; set; }

        public string Phone { get; set; }

        public string Email { get; set; }

        [NotInsertUpdate]
        public override string Table { get { return "Partners"; } }

        /// <summary>
        /// proc_Customer_Insert
        /// </summary>
        [NotInsertUpdate]
        public override string InsertProcedure { get { return "proc_Partner_Insert"; } }

        /// <summary>
        /// proc_Customer_Update
        /// </summary>
        [NotInsertUpdate]
        public override string UpdateProcedure { get { return "proc_Partner_Update"; } }

        /// <summary>
        /// proc_Customer_Get
        /// </summary>
        [NotInsertUpdate]
        public override string SelectProcedure { get { return "proc_Partner_Select"; } }
    }

    public class CustomerENT : PartnerENT
    {
        [Output]
        public override int PartnerID { get; set; }

        [Require]
        public int? PartnerGroupID { get; set; }

        public string Address { get; set; }

        public string TaxCode { get; set; }

        public string SalesRep { get; set; }
    }

    public class SupplierENT : PartnerENT
    {
        [Output]
        public override int PartnerID { get; set; }

        public decimal? VAT { get; set; }

        public decimal? Surcharge { get; set; }

        [Require]
        [NotInsertUpdate]
        public int? CarrierID { get; set; }
    }
}